package com.opennice.soukaoti.action;

import java.util.ArrayList;

import com.opennice.soukaoti.index.IndexUtilInterface;
import com.opennice.soukaoti.index.KaoTiIndexBean;
import com.opensymphony.xwork2.ActionSupport;
public class CloudSearchAction extends ActionSupport {

	String  k;
	ArrayList<KaoTiIndexBean> resultKaoti;
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private IndexUtilInterface searchService;
    public String showSearch() throws Exception{
    	System.out.println("CloudSearchAction");
    	System.out.println(k);
    	if(k!=null&&k.length()>0){
    		resultKaoti=searchService.searchQueryAsptName(k, 1, 1);
    		System.out.println(resultKaoti.size());
    	}
		return "showSearchResult";
	}
	public String getK() {
		return k;
	}
	public void setK(String k) {
		this.k = k;
	}
	public IndexUtilInterface getSearchService() {
		return searchService;
	}
	public ArrayList<KaoTiIndexBean> getResultKaoti() {
		return resultKaoti;
	}
	public void setResultKaoti(ArrayList<KaoTiIndexBean> resultKaoti) {
		this.resultKaoti = resultKaoti;
	}
	public void setSearchService(IndexUtilInterface searchService) {
		this.searchService = searchService;
	}
	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
}
